<?php
$menumark = 'vipcategory';


switch ($act) {
    //#####################@ 添加广告 @#####################//
    case 'vipcategory_add':
        if (isGet()) {
            include(pe_tpl('vipcategory_add.html'));
        } else if (isPost()) {

            if ($db->pe_insert('vipcategory', $_p_info)) {
                pe_success('添加成功');
            } else {
                pe_error('添加失败');
            }
        }

        break;
    //#####################@ 修改分类 @#####################//
    case 'edit':
        if (isGet()) {
            $vipcategory = $db->pe_select('vipcategory',array('vipcategory_id'=>$_g_id));
            include(pe_tpl('vipcategory_edit.html'));
        } else if (isPost()) {

            if ($db->pe_update('vipcategory',array('vipcategory_id'=>$_g_id),$_p_info)) {
                pe_success('修改成功','admin.php?mod=vipcategory');
            } else {
                pe_error('修改失败','admin.php?mod=vipcategory');
            }
        }

        include(pe_tpl('category_add.html'));
        break;
    //#####################@ 分类删除 @#####################//
    case 'del':
        if ($db->pe_delete('vipcategory', array('vipcategory_id' => $_g_id))) {
            pe_success('删除成功');
        } else {
            pe_error('删除失败');
        }
        include(pe_tpl('vipcard_edit.html'));

        break;
    //#####################@ 分类列表 @#####################//
    default :
        $category = $db->pe_selectall('vipcategory');

        include(pe_tpl('vipcategory_list.html'));
        break;
}
?>